<template>
  <div class="form__field--hack">
    <van-form @submit="onSubmit">
      <van-field
        class="required"
        v-model="username"
        name="用户名"
        label="用户名"
        placeholder="用户名"
        :rules="[{ required: true, message: '请填写用户名' }]"
      />
      <van-field
        class="required"
        v-model="password"
        name="密码"
        label="密码"
        placeholder="密码"
        :rules="[{ required: true, message: '请填写密码' }]"
      />
      <div style="margin: 16px;">
        <van-button round block type="info" native-type="submit"
          >提交</van-button
        >
      </div>
    </van-form>
  </div>
</template>
<script>
export default {
  name: "",
  props: {},
  data() {
    return {
      username: "",
      password: ""
    };
  },
  methods: {
    onSubmit() {}
  },
  mounted() {},
  watch: {}
};
</script>
<style lang="less">
.form__field--hack {
  /**input框class*/
  .van-field__control {
    text-align: right;
    &::placeholder {
      color: #86909c !important;
    }
  }
  .van-field__error-message {
    text-align: right;
  }
  .van-cell {
    //  border-bottom: 0.5px solid #86909c;
  }
  .required {
    position: relative;
    &::before {
      display: inline-block;
      margin-right: 4px;
      color: #ff4d4f;
      font-size: 14px;
      font-family: SimSun, sans-serif;
      line-height: 1;
      content: "*";
    }
   
  }
}
</style>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.main {
}
</style>
